package com.newzqxq.common.enums;

import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * @author 石清
 * @Description
 * @create 2017-12-06 17:02
 **/
public enum  OrderEnums {
     APPLY(1,"审核中","审核中", "待审核")
    ,AUDIT_SUCCESS(2,"审核通过","审核中", "通过初审")
    ,REMIT_DOING(3,"打款中","打款中", "打款中")
    ,REMIT_SUCCESS(4,"待还款","待还款", "待还款")
    ,REPAID_SUCCESS(5,"还款成功","还款成功", "已还款")
    ,AUDIT_FAIL(91,"审核失败","审核失败", "拒绝初审")
    ,REFUSE_REMIT(92,"拒绝放款","审核失败", "拒绝放款")
    ,REMIT_FAIL(93,"打款失败","打款失败", "打款失败")
    ,CANCLE(94,"订单失效","订单失效", "取消订单")

    ,MACHINE_AUDITS(0,"未审核","","")
    ,MACHINE_AUDITS_SUCCESS(1,"审核成功","","")
    ,MACHINE_AUDITS_FAIL(2,"审核失败","","")
    ;
    private int code;   //数据库编码
    private String message; //数据库消息
    private String userMessage; //前端消息
    private String backMessage; //后台消息
    OrderEnums() {
    }

    /**
     * 通过code查询枚举
     * @param code
     * @return
     */
    public static OrderEnums getOrderEnumsByCode(int code){
        for (OrderEnums orderEnums:OrderEnums.values()){
            if (orderEnums.getCode()==code){
                return orderEnums;
            }
        }
        return null;
    }
    OrderEnums(Integer code, String message, String userMessage,String backMessage) {
        this.code = code;
        this.backMessage = backMessage;
        this.userMessage = userMessage;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getBackMessage() {
        return backMessage;
    }

    public void setBackMessage(String backMessage) {
        this.backMessage = backMessage;
    }

    public String getUserMessage() {
        return userMessage;
    }

    public void setUserMessage(String userMessage) {
        this.userMessage = userMessage;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
